function [posteriori1, posteriori2, errors] = q2d(test_patterns, ...
    test_targets, pi_a, pi_b, pi_c)
%Q2D

    p = pi_a + pi_b + pi_c;

    patternCount = length(test_targets);
    result_targets = zeros(1, patternCount);

    for i=1:patternCount
         if p(1,i) < p(2,i)
             result_targets(i) = 1;
         else
             if p(1,i) == p(2,i)
                 disp('whatif');
             end
         end
    end

    errors = calculateError(result_targets, test_targets);
    posteriori1 = length(find(result_targets==0))/length(result_targets);
    posteriori2 = length(find(result_targets==1))/length(result_targets);

end